<div class="hmb">
<div class="hmbs" id="h-banners">
<ul>
<li><img src="{$CONTEXT.STYLEIMG}m/banner_1.jpg"></li>
<li><img src="{$CONTEXT.STYLEIMG}m/banner_2.jpg"></li>
</ul>
</div>
<div class="hmbl"><img src="{$CONTEXT.STYLEIMG}m/banner_line.jpg"></div>
</div>

<div class="hmc">
<div class="h-row">
<div class="h-events">
<a href="javascript:void(0);"><span class="nav-left" id="h-events-nav-left"></span></a>
<div class="h-events-items" id="h-events-items">
<ul>
{section name=item loop=$CONTENT.event_items}
<li><a href="{$CONTEXT.URL}event/{$CONTENT.event_items[item].link}{$CONTEXT.URL_SUFFIX}" title="{$CONTENT.event_items[item].subject}">{pp_pimage src=$CONTENT.event_items[item].image url=$CONTEXT.URLBASE path_prefix="===CONFIG_DIR_UPLOADS_THUMBS" width=$CONTENT.event_items[item].image_width height=$CONTENT.event_items[item].image_height lw="120" lh="90" alt=$CONTENT.event_items[item].subject}</a></li>
{/section}
</ul>
</div>
<a href="javascript:void(0);"><span class="nav-right" id="h-events-nav-right"></span></a>
</div>
<div class="h-news">
<span class="title"></span>
<ul>
{section name=item loop=$CONTENT.news_items}
<li><a href="{$CONTEXT.URL}n/{$CONTENT.news_items[item].link}{$CONTEXT.URL_SUFFIX}" title="{$CONTENT.news_items[item].subject}">{$CONTENT.news_items[item].subject|substr:0:42}</a>
<span class="t">{$CONTENT.news_items[item].date_added|time}</span></li>
{/section}
</ul>
</div>
</div>

<div class="h-row">
<div class="h-products" id="h-products">
<span class="title"></span>
{section name=item loop=$CONTENT.products_items}
<div class="item" {if $smarty.section.item.index > 0} style="display: none; "{/if}>
<div class="imgd"><a href="{$CONTEXT.URL}p/{$CONTENT.products_items[item].link}{$CONTEXT.URL_SUFFIX}" title="{$CONTENT.products_items[item].name}">{pp_pimage src=$CONTENT.products_items[item].image eid=$CONTENT.products_items[item].id url=$CONTEXT.URLBASE path_prefix="===CONFIG_DIR_UPLOADS_RESIZED" width=$CONTENT.products_items[item].image_width height=$CONTENT.products_items[item].image_height lw="216" lh="188" alt=$CONTENT.products_items[item].name}</a></div>
<div class="name"><a href="{$CONTEXT.URL}p/{$CONTENT.products_items[item].link}{$CONTEXT.URL_SUFFIX}">{$CONTENT.products_items[item].name}</a></div>
<div class="desc">{$CONTENT.products_items[item].introtext|nl2br}</div>
<a href="{$CONTEXT.URL}p/{$CONTENT.products_items[item].link}{$CONTEXT.URL_SUFFIX}"><div class="more"></div></a>
</div>
{/section}
<div class="h-products-nav"></div>
</div>
<div class="h-video">
<span class="title"></span>
<div class="pb"></div>
</div>
</div>
</div>

{literal}
<script type="text/javascript" language="javascript">
$(document).ready(function(){
	//
	//EVENTS
	var h_events_items_count = $('#h-events-items li').length;
	var h_events_items_cc = 0;
	$('#h-events-items ul').css("width",h_events_items_count*168+2);
	$('#h-events-nav-left').hover(function(){$(this).addClass("nav-left-over");},function(){$(this).removeClass("nav-left-over");});
	$('#h-events-nav-right').hover(function(){$(this).addClass("nav-right-over");},function(){$(this).removeClass("nav-right-over");});
	$('#h-events-nav-left').click(function(){
			h_events_items_cc=h_events_items_cc-1;
			if( h_events_items_cc < 0 ){
				h_events_items_cc = 0;
			}
			$('#h-events-items').animate({scrollLeft: h_events_items_cc*168}, 
				300, 'swing', //swing/linear, 
				function(){
					// Animation complete.
					})});
	$('#h-events-nav-right').click(function(){
			h_events_items_cc=h_events_items_cc+1;
			if( h_events_items_cc+3 > h_events_items_count ){
				//h_events_items_cc = h_events_items_count-3;
				h_events_items_cc = 0;
			}
			$('#h-events-items').animate({scrollLeft: h_events_items_cc*168}, 
				300, 'swing', //swing/linear, 
				function(){
					// Animation complete.
					})});
	//
	//BANNERS
	var h_banners_cc = 0;
	var h_banners_count = $('#h-banners img').length;
	var h_banners_cont = $('#h-banners ul').html();
	$('#h-banners ul').html(h_banners_cont+""+h_banners_cont).css("width",h_banners_count*2*950);
	//
	function banner_ds(){
		$('#h-banners img').each(function(i){
				//$(this).css('opacity', 0);
				if(i==h_banners_cc){
					//$(this).css('display', '');
				} else {
					//$(this).css('display', 'none');
				}
					});
		$('#h-banners').animate({scrollLeft: h_banners_cc*950},
					400, 'swing', //swing/linear, 
					function(){
						// Animation complete.
						h_banners_cc++;
						if(h_banners_cc>h_banners_count){
							h_banners_cc = 1;
							$(this).scrollLeft(0);
						}
						});
	}
	setInterval(banner_ds, 3000);
	//
	//PRODUCTS
	var h_products_cc = 0;
	var h_products_count = $('#h-products div.item').length;
	var h_products_status = 0;
	setInterval(function(){
		if(h_products_status == 1) return;
		h_products_cc++;
		if(h_products_cc == h_products_count){
			h_products_cc = 0;
		}
		$('#h-products div.item').each(function(i){
			if(h_products_cc==i){
				$(this).show();
				$('#h-products-nav-'+i).addClass("cc");
			} else {
				$(this).hide();
				$('#h-products-nav-'+i).removeClass("cc");
			}
		});
	}, 3000);
	$('#h-products div.item').each(function(){
		$(this).hover(function(){h_products_status=1;}, function(){h_products_status=0;});
	});
	var h_products_nav;
	for(var i=0; i<h_products_count; i++){
		$('#h-products div.h-products-nav').append("<span id='h-products-nav-"+i+"'>"+(i+1)+"</span>");
	}
	$('#h-products div.h-products-nav span').each(function(){
		$(this).hover(function(){h_products_status=1;}, function(){h_products_status=0;});
		$(this).click(function(){
			h_products_cc=parseInt($(this).text())-1;
			$('#h-products div.h-products-nav span').each(function(i){
				if(h_products_cc==i){
					$(this).addClass("cc");
				} else {
					$(this).removeClass("cc");
				}
			});
			$('#h-products div.item').each(function(i){
				if(h_products_cc==i){
					$(this).show();
				} else {
					$(this).hide();
				}
			});
		});
	});
});
</script>
{/literal}